﻿@model IEnumerable<CREAPA.Dominio.GrupoProblemaOs>

@{
    ViewBag.Title = "Grupo de Problema";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Grupos de Problemas</h2>



@{
    if (TempData["notice"] != null) {
    
        string msg = @TempData["notice"].ToString();
    
        <script type="text/javascript">

            alert('OS Gravada com sucesso');

    </script>
    }

    }

<p>
    @Html.ActionLink("Cadastrar Grupo de Problema", "Cadastrar", null, new { @class = "link-button" })
</p>
<br />

@{
    WebGrid grid = new WebGrid(source: Model, columnNames: new string[] { "Id", "Descricao"}, canPage: true, rowsPerPage: 200);
}

@grid.GetHtml( tableStyle: "table",
        alternatingRowStyle: "alternate",
        headerStyle: "header",
        footerStyle: "footer",
        mode: WebGridPagerModes.FirstLast | WebGridPagerModes.NextPrevious,
        firstText: "Primeiro",
        previousText: "Anterior",
        nextText: "Próximo",
        lastText: "Último",columns: grid.Columns(
              grid.Column("Id", header:"Número", format: @<text><center>@item.Id</center></text>),          
              grid.Column("Descricao", header:"Descrição", format: @<text><div style='width: 30em'>@item.Descricao</div></text>),
              
            grid.Column("Alterar",   header: "Alterar",   format: @<text><center>@Html.ActionLink("Alterar", "Alterar", new { id = item.Id })</center></text>),
            grid.Column("Excluir",   header: "Excluir",   format: @<text><center>@Html.ActionLink("Excluir", "Excluir", new { id = item.Id })</center></text>)
	          
           )
)